<?php

/*

Discounts (discounts.php)

*/

$page_title = "Discount Cards";
$rank_check = 1;
include "header.inc.php";

$findDiscount = fetch("SELECT * FROM discount_cards WHERE user = '$userid' AND game = '$game'");
$discountRate = "0%";
if ($findDiscount[id])
{
	$discount = $findDiscount[discount];
	$discountRate = $discount * 100;
	$discountRate = "$discountRate%";
}

$explodeR = explode(", ", $findDiscount[reasons]);
$countR = count($explodeR);
for ($x = 1; $x <= $countR;)
{
	$reasons .= "$explodeR[$x]<br>";
	$x++;
}

print "$openHTML";

ECHO <<<END

<p align=center><font size=+2>Current Discount Rate: $discountRate</font></p>

<p>You can receive discount cards a couple of different ways. Admins/Staff can reward them to users as prizes for contests or quests, you may receive a bonus on your card from a random event (but they may also take away some of your discount!) But the easiest way to get an instant %10 is to go <a href=upgrade.php?game=$game><font color=blue>PREMIUM!</font></a> Below is a list of what you have done to earn your discount rate!</p>

<p align=center>$reasons</p>

END;

print "$closeHTML";
?>